public class fndA_Tsk {

    public Id Ann_id {get; set;}
    public Id User_id {get; set;}
//    private final List<A_task__c> A_Tsk= new List<A_task__c>();
    //public Id Announ_Id = ApexPages.currentPage().getParameters().get('relatedTo_Id');

    public fndA_Tsk() {
    }
    
    
     public PageReference verifyParameters() {
        if (ApexPages.currentPage().getParameters().containsKey('paramAnn_Id')){
              Ann_Id = ApexPages.currentPage().getParameters().get('paramAnn_Id');
              if (ApexPages.currentPage().getParameters().containsKey('paramUsr_Id')){
                  User_Id = ApexPages.currentPage().getParameters().get('paramUsr_Id');
                  getA_Tsk();
              }
       }  
       
        return null;
    }

    public List<A_task__c> getA_Tsk() {
//    public List<A_Task_User__c> getA_Tsk() {
//    public List<User> getA_Tsk() {
    //Select a.PersonContactId, a.Name, a.Id From Account a
    List<Account> accounts =[Select PersonContactId, Name, Id From Account WHERE PersonContactId=:User_id LIMIT 1];
//    return[Select PersonContactId, Name, Id From Account WHERE PersonContactId=:User_id LIMIT 1];
//    System.debug(accounts[0].Id);
    Set<Id> ids_acc = new Set<Id>();
    for(Account account_current : accounts){    
        ids_acc.add(account_current.Id);
    } 
    List<User> users = [SELECT Id,Name FROM User WHERE AccountId IN :ids_acc LIMIT 1];
//    return [SELECT Announcement_Task__c,Name FROM A_Task_User__c WHERE User__c IN :ids_acc];
//    return [SELECT Id,Name FROM User WHERE AccountId IN :ids_acc];
    Set<Id> ids_usr = new Set<Id>();
    for(User usr : users){    
        ids_usr.add(usr.Id);
    }         
    List<A_Task_User__c> tasks_user = [SELECT Id, Announcement_Task__c,Name FROM A_Task_User__c WHERE User__c IN :ids_usr];
//    return [SELECT Id, Announcement_Task__c,Name FROM A_Task_User__c WHERE User__c IN :ids_usr];
    Set<Id> ids_atskc = new Set<Id>();
    for(A_Task_User__c t_usr : tasks_user){    
        ids_atskc.add(t_usr.Announcement_Task__c);
    }  
    
//    return [SELECT Announcement_Task__c,Name FROM A_Task_User__c WHERE User__c IN :ids_usr ];
    return [select Name,Due_Date__c from A_task__c WHERE (A_task__c.Id IN :ids_atskc) AND (Announcement__c=:Ann_id) ];
    }
}